package com.ozner.WaterPurifier.RoWifi;


import com.ozner.util.ByteUtil;

/**
 * description: RoWifiStatus：水机状态信息
 * autour: ozner_67
 * date: 2017/8/1 10:03
 * e-mail: xinde.zhang@cftcn.com
 */
public class RoWifiStatus {
    public int TDS1;
    public int TDS2;
    /**
     * 臭氧杀菌
     */
    public boolean Sterilization = false;

    public void fromBytes(byte[] data) {
        this.Sterilization = data[15] == 0 ? false : true;
        this.TDS1 = ByteUtil.getShort(data, 16);
        this.TDS2 = ByteUtil.getShort(data, 18);
    }

    @Override
    public String toString() {
        return "RoWifiStatus{" +
                "TDS1=" + TDS1 +
                ", TDS2=" + TDS2 +
                ", Sterilization=" + Sterilization +
                '}';
    }
}
